import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'
Vue.use(Router)

const routes = [{
    path: '/',
    component: Layout,
    redirect: '/heros',
    children: [{
      path: 'heros',
      name: 'heros',
      component: () => import('@/views/heros/index')
    }]
  },
  {
    path: '/',
    component: Layout,
    redirect: '/players',
    children: [{
      path: 'players',
      name: 'players',
      component: () => import('@/views/players/index')
    }]
  }
]

const  router = new Router({
    // hash模式：createWebHashHistory，
    // history模式：createWebHistory
    // history: createWebHistory("/"),
    // history:createWebHashHistory(),
    routes,
});


export default router;